﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Search_ShowResult : System.Web.UI.Page
{
    private string ModelType
    {
        get
        {
            if (Request["ModelType"] != null)
            {
                return Request["ModelType"].ToString();
            }
            return string.Empty;
        }
    }

    private int ModelId
    {
        get
        {
            if (Request["ModelId"] != null)
            {
                return int.Parse(Request["ModelId"].ToString());
            }
            return -1;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (ModelType == string.Empty)
            return;
        Control ctrl = null;
        switch (ModelType)
        {
            case "1"://ElibResBook
                ctrl = Page.LoadControl("UC/ShowBookInfo.ascx");
                break;
            case "2"://ElibResDigitalResource
                ctrl = Page.LoadControl("UC/ShowDigitalResource.ascx");
                break;
            case "3"://ElibResMultimedia
                break;
            case "4"://ElibResNewspaper
                ctrl = Page.LoadControl("UC/ShowNewspaper.ascx");
                break;
            case "5"://ElibResOtherResource
                ctrl = Page.LoadControl("UC/ShowOtherResource.ascx");
                break;
            case "6"://ElibResPeriodical
                break;
            case "7"://ElibResTheses
                ctrl = Page.LoadControl("UC/ShowBookInfo.ascx");
                break;
            default:
                break;
        }
        if (ctrl != null)
        {
            placeModelInfo.Controls.Add(ctrl);
        }
    }
}
